﻿
@inherits WidgetComponentBase

@if (Component != null)
{
    <BootstrapInput PlaceHolder="请输入 ..."
                    Id="@Component.Id"
                    Readonly="@Component.Props["ReadOnly"].BoolVal"
                    OnEnterAsync="OnPressEnter"
                    TValue="string"
                    IsAutoFocus="true"
                    IsSelectAllTextOnFocus="true"
                    ShowLabel="true"
                    DisplayText="@Component.MutLanguage.GetLanguage()"
                    @bind-Value="@(Component.ValueInfo.StringValue)" />
}
else
{
    <div>
        失败的控件,控件数据为空
    </div>
}

@*    </div>
</form>*@
@code {
    private async Task OnPressEnter(string e)
    {
        var storeName = Component.Props["StoreName"].StringValue;
        await ToastService.Warning($"将要执行存储过程:{storeName}");

        var msg = string.Join("|", Component.Props["Params"].StringListValue);
        foreach (var item in Component.Props["Params"].StringListValue)
        {
            var ss = RootContainer.FindFirst(x => x.Id == item);
            if (ss is not null)
            {
                await ToastService.Warning($"控件{ss.Name}的值是:{ss.ValueInfo.StringValue}");
            }
        }
        StateHasChanged();
    }
}
